<template>
  <div>
    <el-dialog :visible.sync="isshow" :title="text.title" center>
      <el-row class="detail-body" v-loading="loading">
        <p>
            <span>时间：{{text.addTime}}</span>
            <span>作者：{{text.author}}</span>
            <span>{{text.hot=="1"?'热门':''}}</span>
        </p>
        <p v-html="text.content1">
        </p>
        <img style="height:200px" :src="text.cover" alt="">
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
import news from "@/api/newsManager/news";
export default {
  data() {
    return {
      loading: false,
      isshow: false,
      text:""
    };
  },
  methods: {
    showDetail(id) {
      this.loading = true;
      news
        .newsDetail({
          id: id
        })
        .then(res => {
          this.text=res.data.data
          this.loading = false;
          console.log(res)
        })
        .catch(res => {
          this.loading = false;
          this.$message({
            message: "网络有误，请稍后重试",
            type: "error"
          });
        });
    }
  }
};
</script>

<style lang="scss" scoped>
*{
    margin: 0 0;
    padding: 0 0;
}
ul,ol{
    list-style: none;
}
a{
    text-decoration: none;
}
img{
    display: inline-block;
}

.detail-body{
    span{
        margin: 10px;
    }
    text-align: center;
}

</style>